home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / ifp1s155.zip / MAKEHELP.PAS < prev    next >
Pascal/Delphi Source File  |  1992-04-21  |  2KB  |  70 lines

  1. program makehelp;
  2.  
  3. type
  4.   tabletype = array[0..63] of longint;
  5.  
  6. const
  7.   version: longint = 155;
  8.   firstfile = 0;
  9.   lastfile = 21;
  10.  
  11. var
  12.   tablefile: file of tabletype;
  13.   bytefile: file of byte;
  14.   infile, outfile: text;
  15.   inname, outname, s: string;
  16.   thetable: tabletype;
  17.   filecount: word;
  18.   file_size: longint;
  19.  
  20. begin
  21. Writeln('Making INFOPLUS.HLP for version ', version);
  22. Writeln('Creating pages ', firstfile, ' through ', lastfile);
  23. FillChar(thetable, Sizeof(thetable), #0);
  24. Assign(bytefile, 'INFOPLUS.HLP');
  25. {$I-} Erase(bytefile); {$I+}
  26. for filecount:=firstfile to lastfile do
  27.   begin
  28.   Assign(bytefile, 'INFOPLUS.HLP');
  29.   {$I-} Reset(bytefile); {$I+}
  30.   if IOResult <> 0 then
  31.     ReWrite(bytefile);
  32.   file_size:=FileSize(bytefile);
  33.   Close(bytefile);
  34.   Assign(tablefile, 'INFOPLUS.HLP');
  35.   {$I-} Reset(tablefile); {$I+}
  36.   Writeln(filecount, '-', file_size);
  37.   Seek(tablefile, 0);
  38.   if file_size > 0 then
  39.     Read(tablefile, thetable)
  40.   else
  41.     file_size:=256;
  42.   thetable[63]:=version;
  43.   thetable[filecount]:=file_size;
  44.   Seek(tablefile, 0);
  45.   Write(tablefile, thetable);
  46.   Close(tablefile);
  47.   Str(filecount, s);
  48.   if filecount < 10 then
  49.     s:='0' + s;
  50.   Assign(infile, 'PAGE_' + s + '.INF');
  51.   {$I-}; Reset(infile); {$I+}
  52.   if IOResult <> 0 then
  53.     begin
  54.     Writeln('Unable to open PAGE_', s, '.INF!!'^G);
  55.     Halt
  56.     end;
  57.   Assign(outfile, 'INFOPLUS.HLP');
  58.   Append(outfile);
  59.   while not Eof(infile) do
  60.     begin
  61.     Readln(infile, s);
  62.     Writeln(outfile, s);
  63.     end;
  64.   Writeln(outfile, '$END');
  65.   Close(outfile);
  66.   Close(infile);
  67.   end;
  68. end.
  69.  
  70.